﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace EmployeePractice
{
    class HourlyWorker:Employee
    {
        public HourlyWorker(string strName, int rate, int hours):base(strName)
        {
            if (rate < 0)
                throw new ArgumentOutOfRangeException("Wrong rate!");
            Rate = rate;
            if (rate < 0)
                throw new ArgumentOutOfRangeException("Wrong hours!");
            Hours = hours;

        }
        public int Rate { get; private set; }
        public int Hours { get; private set; }
        public int Salary { get; private set; }
        public override void CalculateSalary()
        {
            Console.WriteLine("{0} salary is: ${1}", Name, Rate * Hours);
        }
    }
}
